package com.clpms.utils;

/**
 * @author caixinyong
 * @date 2023/4/23 2:41 PM
 */
public class UserUtils {

	private UserUtils() {
	}

	// 这里是ThreadLocal，需要有user实体
	private static final ThreadLocal<CurrentUser> CURRENT_USER = new ThreadLocal<>();

	public static void set(CurrentUser currentUser) {
		CURRENT_USER.set(currentUser);
	}

	public static CurrentUser get() {
		return CURRENT_USER.get();
	}

	// 方便使用后移除ThreadLocal
	public static void remove() {
		CURRENT_USER.remove();
	}
}
